/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JAVIER
 */
@Entity
@Table(name = "passtable")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Passtable.findAll", query = "SELECT p FROM Passtable p"),
    @NamedQuery(name = "Passtable.findByIdPass", query = "SELECT p FROM Passtable p WHERE p.idPass = :idPass"),
    @NamedQuery(name = "Passtable.findByUser", query = "SELECT p FROM Passtable p WHERE p.user = :user"),
    @NamedQuery(name = "Passtable.findByPass", query = "SELECT p FROM Passtable p WHERE p.pass = :pass"),
    @NamedQuery(name = "Passtable.findByNivel", query = "SELECT p FROM Passtable p WHERE p.nivel = :nivel")})
public class Passtable implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_pass")
    private Integer idPass;
    @Size(max = 45)
    @Column(name = "user")
    private String user;
    @Size(max = 45)
    @Column(name = "pass")
    private String pass;
    @Column(name = "nivel")
    private Integer nivel;

    public Passtable() {
    }

    public Passtable(Integer idPass) {
        this.idPass = idPass;
    }

    public Integer getIdPass() {
        return idPass;
    }

    public void setIdPass(Integer idPass) {
        this.idPass = idPass;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public Integer getNivel() {
        return nivel;
    }

    public void setNivel(Integer nivel) {
        this.nivel = nivel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPass != null ? idPass.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Passtable)) {
            return false;
        }
        Passtable other = (Passtable) object;
        if ((this.idPass == null && other.idPass != null) || (this.idPass != null && !this.idPass.equals(other.idPass))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entidades.Passtable[ idPass=" + idPass + " ]";
    }
    
}
